Script: --on windowEvent wdID,wdName,objNo,objName,objValue¬¬Global titleList, selectedTitleNums¬global gWindowPositions, gListStartIndex¬global gListPage, gMultiListSelections¬global gShowOnlyMyTitles, gMyTitleList, gMyTitleIndexedList, gMyTitleIndex, gOldShowOnlyMyTitles¬¬---------------------¬-- This is window #22¬---------------------¬¬if objValue="Open" then ¬ set cursor to watch¬ if the short name of this background <> "Title" then ¬ lock screen¬ go cd 1 of bg "Title"¬ end if¬ ¬ -- Restore old window position¬ put OldWindowPosition(22) into windowRect¬ if windowRect = empty then centerWindow wdName¬ else wsSet "Select Titles","0","Rect",windowRect¬ ¬ put gShowOnlyMyTitles into gOldShowOnlyMyTitles -- Save old setting, but default to showing only my titles¬ put true into gShowOnlyMyTitles¬ set cursor to watch¬ send UpdateMyTitlesList to cd 2¬ ¬ wsSet "Select Titles","9","Hilite", not (gShowOnlyMyTitles)¬ wsSet "Select Titles","10","Hilite", gShowOnlyMyTitles¬ ¬ put empty into gMultiListSelections¬ ¬ put 0 into gListStartIndex¬ put the last item of selectedTitleNums into endSelect¬ ¬ ¬ if gShowOnlyMyTitles then¬ -- Build list of just the ones that are collected¬ put the number of lines of titleList into numLines¬ put xlate(MatCreate(1,numLines,"count"),comma,return) into linesList¬ put insColumn(titleList,lineslist,2,tab) into indexedList¬ put insColumn(indexedList,gHasIssuesList,3,tab) into indexedList¬ put selectLines(indexedList,3,"char","=1",tab) into gMyTitleIndexedList¬ put GetColumn(gMyTitleindexedList,1,1,tab) into gMyTitleList¬ put GetColumn(gMyTitleIndexedList,2,2,tab) into gMyTitleIndex¬ ¬ StoreLongField gMyTitleList,"MyTitleList",the short id of cd 1, true¬ ¬ repeat with x = 2 to 99¬ put (there is a fld ("MyTitlelist " & x - 1) of cd 1) into hasField¬ if not hasField then exit repeat¬ set cursor to busy ¬ put the number of lines of fld ("MyTitlelist " & x) of cd 1 into test¬ if test = 0 then exit repeat¬ put the number of lines of bg fld ("MyTitlelist " & x - 1) of cd 1 into temp¬ put temp + (line (x - 1) of gListStartIndex) into lowerBound¬ put lowerBound into line x of gListStartIndex¬ end repeat¬ else¬ repeat with x = 2 to 99¬ put (there is a fld ("MyTitlelist " & x - 1) of cd 1) into hasField¬ if not hasField then exit repeat¬ set cursor to busy ¬ put the number of lines of bg fld ("Titlelist " & x) of cd 1 into test¬ if test = 0 then exit repeat¬ put the number of lines of bg fld ("Titlelist " & x - 1) of cd 1 into temp¬ put temp + (line (x - 1) of gListStartIndex) into lowerBound¬ put lowerBound into line x of gListStartIndex¬ end repeat¬ end if¬ ¬ -- Figure out how the selection is broken up between pages¬ if the number of lines of gListStartIndex = 1 or the last item of selectedTitleNums <= line 2 of gListStartIndex then ¬ put selectedTitleNums into gMultiListSelections¬ put 1 into gListPage¬ else¬ put xlate(selectedTitleNums,comma,return) into theSelectList¬ repeat with x = the number of lines of gListStartIndex down to 2¬ set cursor to busy ¬ put line x of gListStartIndex into thisStartNum¬ put selectLines(theSelectList,1,"N",">" & thisStartNum) into thisPageSelections¬ put selectLines(theSelectList,1,"N","≤" & thisStartNum) into theSelectList¬ if word 1 of thisPageSelections <> empty then ¬ put xlate(array2Cnst(thisPageSelections,"-",thisStartNum),return,comma) into temp¬ if the last char of temp = comma then delete the last char of temp¬ put temp into line x of gMultiListSelections¬ put x into gListPage¬ end if¬ end repeat¬ ¬ if word 1 of theSelectList <> empty then ¬ put 1 into gListPage¬ put xlate(theSelectList,return,comma) into temp¬ if the last char of temp = comma then delete the last char of temp¬ put temp into line 1 of gMultiListSelections¬ end if¬ end if¬ ¬ if gShowOnlyMyTitles then¬ wsSet "Select Titles","ComicTitles","Text", bg fld ("MyTitlelist " & gListPage) of cd 1¬ put "MyTitleList " & (gListPage + 1) into nextListPage¬ put true into nextIsDisabled¬ if there is a bg fld (nextListPage) of cd 1 then¬ if bg fld (nextListPage) of cd 1 <> empty then put false into nextIsDisabled¬ end if¬ else¬ wsSet "Select Titles","ComicTitles","Text", bg fld ("Titlelist " & gListPage) of cd 1¬ put "TitleList " & (gListPage + 1) into nextListPage¬ put true into nextIsDisabled¬ if there is a bg fld (nextListPage) of cd 1 then¬ if bg fld (nextListPage) of cd 1 <> empty then put false into nextIsDisabled¬ end if¬ end if¬ ¬ put (the number of lines of gListStartIndex > 1) into arrowsAreVisible¬ ¬ wsSet "Select Titles","Properties","i5_Visible:" & arrowsAreVisible & return & "i6_Visible:" & arrowsAreVisible & return & "i7_Visible:" & arrowsAreVisible & return & "ComicTitles_Selection:" & line gListPage of gMultiListSelections & return & "i5_Disabled:" & (gListPage = 1) & return & "i6_Disabled:" & nextIsDisabled & return & "PartLabel_Text:" & "Part " & gListPage & return ¬ ¬ put (wsget("Select Titles","ComicTitles","Selection") < 1) into noSelection¬ wsSet "Select Titles","OK","Disabled",noSelection¬ set cursor to arrow¬ ¬else if objValue="Close" then ¬ -- save the window position¬ put "22" & tab & wdName & tab & wsGet("Select Titles","0","Rect") into line 22 of gWindowPositions¬ ¬ -- Restore old setting of ShowOnlyMytitles¬ put gOldShowOnlyMyTitles into gShowOnlyMyTitles¬end if¬¬--end windowEvent¬¬¬¬¬¬
Params: i4_Text
Result: i3_SelectionText
ItemType: PUSH
Rect: 286,265,358,285
Disabled: TRUE
Name: OK
DefaultItem: TRUE
AutoClose: TRUE
Balloon: Click here to choose the selected titles.
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬Global SelectedTitleNums, gListStartIndex, gMultiListSelections¬global gShowOnlyMyTitles, gMyTitleIndex¬¬set cursor to watch¬put xlate(line 1 of gMultiListSelections,comma,return) into selectedTitleNums¬repeat with x = 2 to the number of lines of gMultiListSelections¬ put xlate(line x of gMultiListSelections,comma,return) into thePageSelections¬ if word 1 of thePageSelections <> empty then¬ put line x of gListStartIndex into pageStartPos¬ put array2Cnst(thePageSelections,"+",pageStartPos) into adjustedList¬ put return & adjustedList after selectedTitleNums¬ end if¬end repeat¬repeat while the first char of selectedTitleNums = return¬ delete the first char of selectedTitleNums¬end repeat¬¬if gShowOnlyMyTitles then¬ -- the selections are reallly indexes in gMyTitleIndex¬ repeat with x = 1 to the number of lines of selectedTitleNums¬ set cursor to busy¬ put line (line x of selectedTitleNums) of gMyTitleIndex into line x of selectedTitleNums¬ end repeat¬end if¬¬put xlate(selectedTitleNums,return,comma) into selectedTitleNums¬--end mouseUp¬¬
ItemType: PUSH
Rect: 200,265,272,285
AutoSize: FALSE
Name: Cancel
CancelItem: TRUE
AutoClose: TRUE
Balloon: Click here to exit without choosing any titles.
ItemType: LIST
Rect: 10,44,358,254
TextFont: Geneva
TextSize: 10
Name: ComicTitles
DoubleClickItem: 1
KeyScroll: TRUE
Text:
Balloon: This is a list of all the titles in the ComicBase.
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬¬global gMultiListSelections, gListPage¬¬put wsGet("Select Titles","ComicTitles","Selection") into line gListPage of gMultiListSelections¬¬wsSet "Select Titles","OK","Disabled",((word 1 of gMultiListSelections) = empty)¬--end mouseUp
ItemType: TEXT
Rect: 13,7,354,22
TextFont: Geneva
TextSize: 10
AutoSize: FALSE
Name: Prompt
WhiteColor: -8739,-8739,-8739
ItemType: PICT
Rect: 10,266,27,283
Visible: FALSE
Disabled: TRUE
Name: Prev
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬global gListStartIndex, gMultiListSelections, gListPage¬¬set cursor to watch¬put wsGet(wdID,"ComicTitles","Selection") into temp¬if temp = 0 then put empty into temp¬put temp into line gListPage of gMultiListSelections¬¬subtract 1 from gListPage¬¬if gShowOnlyMyTitles then¬ wsSet wdID,"ComicTitles","Text", bg fld ("MyTitlelist " & gListPage) of cd 1¬else¬ wsSet wdID,"ComicTitles","Text", bg fld ("Titlelist " & gListPage) of cd 1¬end if¬¬¬put false into nextIsDisabled¬wsSet wdID,"ComicTitles","Text", bg fld ("Titlelist " & gListPage) of cd 1¬put false into nextIsDisabled¬wsSet wdID,"Properties","ComicTitles_Selection:" & line gListPage of gMultiListSelections & return & "i5_Disabled:" & (gListPage = 1) & return & "i6_Disabled:" & nextIsDisabled & return & "PartLabel_Text:" & "Part " & gListPage¬¬--end mouseUp
ItemType: PICT
Rect: 64,266,81,283
Visible: FALSE
Disabled: TRUE
Name: Next
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬global gListPage, gMultiListSelections¬global gShowOnlyMyTitles¬¬set cursor to watch¬put wsGet(wdID,"ComicTitles","Selection") into temp¬if temp = 0 then put empty into temp¬put temp into line gListPage of gMultiListSelections¬¬add 1 to gListPage¬¬if gShowOnlyMyTitles then¬ wsSet wdID,"ComicTitles","Text", bg fld ("MyTitlelist " & gListPage) of cd 1¬ put "MyTitlelist " & gListPage + 1 into nextListPage¬else¬ wsSet wdID,"ComicTitles","Text", bg fld ("Titlelist " & gListPage) of cd 1¬ put "TitleList " & gListPage + 1 into nextListPage¬end if¬¬put true into nextIsDisabled¬if there is a bg fld (nextListPage) of cd 1 then¬ if bg fld (nextListPage) of cd 1 <> empty then put false into nextIsDisabled¬end if¬wsSet wdID,"Properties","ComicTitles_Selection:" & line gListPage of gMultiListSelections & return & "i5_Disabled:False" & return & "i6_Disabled:" & nextIsDisabled & return & "PartLabel_Text:" & "Part " & gListPage¬--end mouseUp
ItemType: TEXT
Rect: 29,268,62,280
TextFont: Geneva
TextSize: 9
Visible: FALSE
Name: PartLabel
WhiteColor: -8739,-8739,-8739
TextAlign: Center
Text: Part 1
ItemType: LBL
Rect: 13,23,45,36
TextFont: Geneva
TextSize: 10
Text: Show:
ItemType: RAD
Rect: 50,24,119,37
TextFont: Geneva
TextSize: 10
WhiteColor: -8739,-8739,-8739
Name: All Titles
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬global selectedTitleNum, titleList, gMyTitleList¬global gShowOnlyMyTitles¬¬set cursor to watch¬¬put false into gShowOnlyMyTitles¬¬put empty into gMultiListSelections¬¬put 0 into gListStartIndex¬put the last item of selectedTitleNums into endSelect¬repeat with x = 2 to 4¬ set cursor to busy ¬ put the number of lines of bg fld ("Titlelist " & x) of cd 1 into test¬ if test = 0 then exit repeat¬ put the number of lines of bg fld ("Titlelist " & x - 1) of cd 1 into temp¬ put temp + (line (x - 1) of gListStartIndex) into lowerBound¬ put lowerBound into line x of gListStartIndex¬end repeat¬¬-- Figure out how the selection is broken up between pages¬if the number of lines of gListStartIndex = 1 or the last item of selectedTitleNums <= line 2 of gListStartIndex then ¬ put selectedTitleNums into gMultiListSelections¬ put 1 into gListPage¬else¬ put xlate(selectedTitleNums,comma,return) into theSelectList¬ repeat with x = the number of lines of gListStartIndex down to 2¬ set cursor to busy ¬ put line x of gListStartIndex into thisStartNum¬ put selectLines(theSelectList,1,"N",">" & thisStartNum) into thisPageSelections¬ put selectLines(theSelectList,1,"N","≤" & thisStartNum) into theSelectList¬ if word 1 of thisPageSelections <> empty then ¬ put xlate(array2Cnst(thisPageSelections,"-",thisStartNum),return,comma) into temp¬ if the last char of temp = comma then delete the last char of temp¬ put temp into line x of gMultiListSelections¬ put x into gListPage¬ end if¬ end repeat¬ ¬ if word 1 of theSelectList <> empty then ¬ put 1 into gListPage¬ put xlate(theSelectList,return,comma) into temp¬ if the last char of temp = comma then delete the last char of temp¬ put temp into line 1 of gMultiListSelections¬ end if¬end if¬¬wsSet wdID,"ComicTitles","Text", bg fld ("Titlelist " & gListPage) of cd 1¬put "TitleList " & (gListPage + 1) into nextListPage¬put true into nextIsDisabled¬if there is a bg fld (nextListPage) of cd 1 then¬ if bg fld (nextListPage) of cd 1 <> empty then put false into nextIsDisabled¬end if¬¬put (the number of lines of gListStartIndex > 1) into arrowsAreVisible¬¬wsSet wdID,"Properties","i5_Visible:" & arrowsAreVisible & return & "i6_Visible:" & arrowsAreVisible & return & "i7_Visible:" & arrowsAreVisible & return & "ComicTitles_Selection:" & line gListPage of gMultiListSelections & return & "i5_Disabled:" & (gListPage = 1) & return & "i6_Disabled:" & nextIsDisabled & return & "PartLabel_Text:" & "Part " & gListPage & return & "OK_Disabled:False" & return¬¬¬--end mouseUp
ItemType: RAD
Rect: 130,24,224,37
TextFont: Geneva
TextSize: 10
WhiteColor: -8739,-8739,-8739
Name: Titles in Stock
Hilite: TRUE
Script: --on mouseUp wdID,wdName,objNo,objName,objValue¬global selectedTitleNum, titleList, gMyTitleList¬global gShowOnlyMyTitles¬¬set cursor to watch¬put true into gShowOnlyMyTitles¬¬send UpdateMyTitlesList to cd 2¬¬put empty into gMultiListSelections¬¬put 0 into gListStartIndex¬put the last item of selectedTitleNums into endSelect¬repeat with x = 2 to 99¬ put (there is a fld ("MyTitlelist " & x - 1) of cd 1) into hasField¬ if not hasField then exit repeat¬ set cursor to busy ¬ put the number of lines of bg fld ("MyTitlelist " & x) of cd 1 into test¬ if test = 0 then exit repeat¬ put the number of lines of bg fld ("MyTitlelist " & x - 1) of cd 1 into temp¬ put temp + (line (x - 1) of gListStartIndex) into lowerBound¬ put lowerBound into line x of gListStartIndex¬end repeat¬¬-- Figure out how the selection is broken up between pages¬if the number of lines of gListStartIndex = 1 or the last item of selectedTitleNums <= line 2 of gListStartIndex then ¬ put selectedTitleNums into gMultiListSelections¬ put 1 into gListPage¬else¬ put xlate(selectedTitleNums,comma,return) into theSelectList¬ repeat with x = the number of lines of gListStartIndex down to 2¬ set cursor to busy ¬ put line x of gListStartIndex into thisStartNum¬ put selectLines(theSelectList,1,"N",">" & thisStartNum) into thisPageSelections¬ put selectLines(theSelectList,1,"N","≤" & thisStartNum) into theSelectList¬ if word 1 of thisPageSelections <> empty then ¬ put xlate(array2Cnst(thisPageSelections,"-",thisStartNum),return,comma) into temp¬ if the last char of temp = comma then delete the last char of temp¬ put temp into line x of gMultiListSelections¬ put x into gListPage¬ end if¬ end repeat¬ ¬ if word 1 of theSelectList <> empty then ¬ put 1 into gListPage¬ put xlate(theSelectList,return,comma) into temp¬ if the last char of temp = comma then delete the last char of temp¬ put temp into line 1 of gMultiListSelections¬ end if¬end if¬¬wsSet wdID,"ComicTitles","Text", bg fld ("MyTitlelist " & gListPage) of cd 1¬put "TitleList " & (gListPage + 1) into nextListPage¬put true into nextIsDisabled¬if there is a bg fld (nextListPage) of cd 1 then¬ if bg fld (nextListPage) of cd 1 <> empty then put false into nextIsDisabled¬end if¬¬put (the number of lines of gListStartIndex > 1) into arrowsAreVisible¬¬wsSet wdID,"Properties","i5_Visible:" & arrowsAreVisible & return & "i6_Visible:" & arrowsAreVisible & return & "i7_Visible:" & arrowsAreVisible & return & "ComicTitles_Selection:" & line gListPage of gMultiListSelections & return & "i5_Disabled:" & (gListPage = 1) & return & "i6_Disabled:" & nextIsDisabled & return & "PartLabel_Text:" & "Part " & gListPage & return & "OK_Disabled:False" & return¬¬--end mouseUp